home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / artAttrToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.4 KB  |  117 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  May 2000 
  22. //
  23. //
  24. //
  25. //  Procedure Name:
  26. //         artAttrToolScript 
  27. //
  28. //  Description:
  29. //        create wrapper around the artSelect command
  30. //
  31. //  Input Arguments:
  32. //        4 ==> enter the tool (create if necessary)
  33. //      3 ==> property sheet box
  34. //
  35. //  Return Value:
  36. //      None.
  37. //
  38. global proc string artAttrToolScript( 
  39.     int     $setToTool, 
  40.     string     $attrFilter
  41. )
  42. //
  43. //    Description :
  44. //        4 ==> enter the tool
  45. {
  46.     global string $gArtAttrFilterLabel;
  47.     global string $gArtAttrCurrentAttr;
  48.  
  49.     $gArtAttrFilterLabel = "Filter: all";
  50.     $gArtAttrCurrentAttr = "";
  51.  
  52.     string $tool = "artAttrContext";
  53.     if ( $attrFilter == "" ) {
  54.         // General Attribute Paint Tool.
  55.         makePaintable -activateAll true;
  56.         makePaintable -activate false "mesh" "vertexColorRGB" ;
  57.         makePaintable -activate false "mesh" "vertexFaceColorRGB" ;
  58.         makePaintable -activate false "skinCluster" "*";
  59.         $gArtAttrFilterLabel = "Filter: all";
  60.     } 
  61.     else if ( $attrFilter == "cluster" ) {
  62.         // Cluster Paint Weight Tool.
  63.         makePaintable -activateAll false;
  64.         makePaintable -activate true "cluster" "weights";
  65.         
  66.         // Set the filter label.
  67.         $gArtAttrFilterLabel = "Filter: cluster";
  68.     } 
  69.     else if ( $attrFilter == "jiggle" ) {
  70.         // Jiggle Paint Weight Tool.
  71.         makePaintable -activateAll false;
  72.         makePaintable -activate true "jiggle" "weights";
  73.  
  74.         // Set the filter label.
  75.         $gArtAttrFilterLabel = "Filter: jiggle";
  76.     }
  77.     else if ( $attrFilter == "polyReduce" ) {
  78.         // Poly Reduce Paint Weight Tool.
  79.         makePaintable -activateAll false;
  80.         makePaintable -activate true "polyReduce" "weights";
  81.  
  82.         // Set the filter label.
  83.         $gArtAttrFilterLabel = "Filter: polyReduce";
  84.     }
  85.     else if ( $attrFilter == "particle" ) {
  86.         // Soft Body Paint Tool.
  87.         makePaintable -activateAll false;
  88.         makePaintable -activate true "particle" "*";
  89.  
  90.         // Set the filter label.
  91.         $gArtAttrFilterLabel = "Filter: particle";
  92.     }
  93.  
  94.     // Create a tool if it does not exists.
  95.     if( ! `artAttrCtx -exists $tool` ) {
  96.         rememberCtxSettings `artAttrCtx -i1 "attrPaint.xpm" -whichTool "general" $tool`;
  97.     }
  98.     setToolTo $tool;
  99.  
  100.     if( 3 == $setToTool ) {
  101.         toolPropertyWindow;
  102.  
  103.         // Make sure that the filer is displayed. 
  104.         if (`button -q -ex artAttrFilterButton`) {
  105.             button -e -label $gArtAttrFilterLabel artAttrFilterButton;
  106.         }
  107.     }
  108.     else {
  109.         if( 4 != $setToTool ) {
  110.             warning( "Wrong input for artAttrToolScript" );
  111.         } else if (!artAttrInitPaintableAttr()) {
  112.             warning("Select an object that has paintable attributes.");
  113.         }
  114.     }
  115.     return $tool;
  116. }
  117.